class Person {
  late String name;
  late int age;
  //---默认构造函数的简写
  // Person(this.name, this.age);
  //---命名构造函数
  void setName(String name, int age) {
    this.name = name;
    this.age = age;
  }

  void getInfo() {
    print("${this.name}---${this.age}");
  }
}

void main(List<String> args) {
  // Person p = new Person("张三", 20);
  Person p = new Person();

  p.setName("张三", 20);
  p.getInfo();
}
